<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <script src="./layui/layui.js"></script>
</head>
<body>
    <div style="margin-right: 40px; width: 400px;">
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" required  lay-verify="required" placeholder="请输入姓名" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">年龄</label>
                <div class="layui-input-block">
                    <input type="text" name="age" required  lay-verify="required" placeholder="请输入年龄" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-block">
                    <input type="radio" name="sex" value="男" title="男" checked>
                    <input type="radio" name="sex" value="女" title="女">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身高</label>
                <div class="layui-input-block">
                    <input type="text" name="height" required  lay-verify="required" placeholder="请输入身高" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">出生日期</label>
                <div class="layui-input-inline">
                    <input type="text" name="birthday" id="birthday" placeholder="请选择出生日期" class="layui-input" readonly>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">部门</label>
                <div class="layui-input-inline">
                    <select name="deptId" lay-verify="required">
                        <option value="">请选择部门</option>
                        <option value="1">研发部</option>
                        <option value="2">营销部</option>
                        <option value="3">运维部</option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="add" style="width: 180px;">添&nbsp;&nbsp;&nbsp;&nbsp;加</button>
                </div>
            </div>
        </form>
    </div>

    <script>
        layui.use(['layer','laydate','form'],function () {
            var layer = layui.layer
            var $ = layui.jquery
            var laydate = layui.laydate;
            var form = layui.form

            //执行一个laydate实例
            laydate.render({
                elem: '#birthday' //指定元素
            });

            form.on('submit(add)',function(data){
                
                return false // 阻止表单的提交
            })

        })
    </script>
</body>
</html>